﻿<UserControl x:Class="SsTool.Core.Parts.NavigationPart"
      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
      xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
      xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
      mc:Ignorable="d" 
      d:DesignHeight="300" d:DesignWidth="600">

    <Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="*"/>
            <ColumnDefinition Width="*"/>
        </Grid.ColumnDefinitions>
        <HeaderedContentControl Grid.Column="0" Margin="5,5,0,5" VerticalContentAlignment="Stretch">
            <HeaderedContentControl.Header>
                <StackPanel Orientation="Horizontal" Margin="0,5,0,5">
                    <Image Source="../Resources/folder.png" Margin="0,0,5,0"/>
                    <TextBlock Text="导航列表" VerticalAlignment="Center"/>
                </StackPanel>
            </HeaderedContentControl.Header>
            <HeaderedContentControl.Content>
                <TreeView Name="_ctlTree" VerticalAlignment="Stretch" BorderThickness="0" SelectedItemChanged="_ctlTree_SelectedItemChanged">
                    <TreeView.Resources>
                        <Style TargetType="TreeViewItem">
                            <Setter Property="IsExpanded" Value="True"/>
                        </Style>
                    </TreeView.Resources>
                    <TreeView.ItemTemplate>
                        <HierarchicalDataTemplate ItemsSource="{Binding Children}">
                            <StackPanel Orientation="Horizontal">
                                <Image Source="../Resources/folder.png" Margin="0,0,5,0"/>
                                <TextBlock Text="{Binding Caption}" VerticalAlignment="Center"/>
                            </StackPanel>
                        </HierarchicalDataTemplate>
                    </TreeView.ItemTemplate>
                </TreeView>
            </HeaderedContentControl.Content>
        </HeaderedContentControl>
        <HeaderedContentControl Grid.Column="1" Margin="5">
            <HeaderedContentControl.Header>
                <StackPanel Orientation="Horizontal" Margin="0,5,5,5">
                    <Image Source="../Resources/folder.png" Margin="0,0,5,0"/>
                    <TextBlock Text="导航详细信息" VerticalAlignment="Center"/>
                </StackPanel>
            </HeaderedContentControl.Header>
            <HeaderedContentControl.Content>
                <StackPanel>
                    <StackPanel Orientation="Horizontal">
                        <Button Name="_ctlBtnEdit" Click="_ctlBtnEdit_Click" Margin="5,5,0,5">
                            <StackPanel Orientation="Horizontal">
                                <Image Source="../../Resources/detail.png" Margin="0,0,5,0"/>
                                <TextBlock Text="修改" VerticalAlignment="Center"/>
                            </StackPanel>
                        </Button>
                        <Button Name="_ctlBtnCreate" Click="_ctlBtnCreate_Click" Margin="5,5,0,5">
                            <StackPanel Orientation="Horizontal">
                                <Image Source="../../Resources/new.png" Margin="0,0,5,0"/>
                                <TextBlock Text="创建" VerticalAlignment="Center"/>
                            </StackPanel>
                        </Button>
                        <Button Name="_ctlSubmit" Click="_ctlSubmit_Click" Margin="5,5,0,5">
                            <StackPanel Orientation="Horizontal">
                                <Image Source="../../Resources/save.png" Margin="0,0,5,0"/>
                                <TextBlock Text="保存" VerticalAlignment="Center"/>
                            </StackPanel>
                        </Button>
                        <Button Name="_ctlSetDefault" Click="_ctlSetDefault_Click" Margin="5,5,0,5">
                            <StackPanel Orientation="Horizontal">
                                <Image Source="../../Resources/save.png" Margin="0,0,5,0"/>
                                <TextBlock Text="设置为默认导航" VerticalAlignment="Center"/>
                            </StackPanel>
                        </Button>
                        <Button Name="_ctlSetShortcut" Click="_ctlSetShortcut_Click" Margin="5,5,0,5">
                            <StackPanel Orientation="Horizontal">
                                <Image Source="../../Resources/save.png" Margin="0,0,5,0"/>
                                <TextBlock Text="设置为快捷方式" VerticalAlignment="Center"/>
                            </StackPanel>
                        </Button>
                    </StackPanel>
                    <StackPanel Name="_ctlNavigationPanel">
                        <TextBlock Text="Parent:"/>
                        <TextBox Text="{Binding Path=Parent.Caption}" IsReadOnly="True"/>
                        <TextBlock Text="Caption:"/>
                        <TextBox Text="{Binding Caption,Mode=TwoWay}"/>
                        <TextBlock Text="View:"/>
                        <TextBox Name="_ctlEditView" IsReadOnly="True" Background="Yellow" MouseDoubleClick="TextBox_MouseDoubleClick" />
                        <Label>OrderIndex:</Label>
                        <TextBox Name="_ctlEditOrderIndex" Text="{Binding OrderIndex,Mode=TwoWay}"/>
                        <TextBlock Text="Arguments:"/>
                        <TextBox Text="{Binding Arguments,Mode=TwoWay}"/>
                        <StackPanel Orientation="Horizontal" Margin="10,0,0,0">
                            <Button Name="_ctlBtnSelectActivity" Content="选择流程-活动" Click="_ctlBtnSelectActivity_Click" />
                        </StackPanel>
                    </StackPanel>
                </StackPanel>
            </HeaderedContentControl.Content>
        </HeaderedContentControl>
    </Grid>
</UserControl>
